import Vue from 'vue'
import Vuex from 'vuex'
import VuexPersistence from 'vuex-persist'

Vue.use(Vuex)

const vuexLocal = new VuexPersistence({
	user: window.localStorage,
	lookPush: window.localStorage,
})

export default new Vuex.Store({
	state: {
		user: {},
		lookPush:'',
	},
	getters: {
		getUser: (state) => {
			return state.user
		},
		getLookPush: (state) => {
			return state.lookPush
		},
	},
	mutations: {
		setUser: (state, data) => {
			state.user = data
		},
		relUser:(state) =>{
			state.user = {}
		},
		setLookPush: (state, data) => {
			state.lookPush = data
		},
		relLookPush:(state) =>{
			state.lookPush = ''
		},
	},
	actions: {},
	modules: {

	},
	plugins: [vuexLocal.plugin]
})
